//
//  YHRequest+Config.h
//  YHNetwork
//
//  Created by 000 on 2021/12/26.
//

#import "YHRequest.h"

NS_ASSUME_NONNULL_BEGIN

#define YHRequestRegister(ResponseClass) [YHRequest<ResponseClass *> new].responseClassRegister(ResponseClass.class)
#define YHRequestRegisterList(ResponseClass) [YHRequest<NSArray<ResponseClass *> *> new].responseClassRegister(ResponseClass.class)

@interface YHRequest<ResponseClass>  (Config)

/// 注册请求返回类的类型
/// 配合泛型使用
- (YHRequest<ResponseClass> *(^)(Class responseClass))responseClassRegister;

/// 配置
- (YHRequest<ResponseClass> *)configure:(void(^)(YHRequest * request, YHRequestConfig * config))configBlock;

- (YHRequest<ResponseClass> *(^)(YTKRequestMethod method))method;
- (YHRequest<ResponseClass> *(^)(void))GET;
- (YHRequest<ResponseClass> *(^)(void))POST;
- (YHRequest<ResponseClass> *(^)(void))PUT;
- (YHRequest<ResponseClass> *(^)(void))DELETE;

/// 请求失败重试次数
- (YHRequest<ResponseClass> *(^)(NSInteger retryTimes))retryTimes;
- (YHRequest<ResponseClass> *(^)(NSInteger retryTimeInterval))retryTimeInterval;


/// 一般是域名
- (YHRequest<ResponseClass> *(^)(NSString * baseurl))baseurl;
/// 域名后路劲信息
- (YHRequest<ResponseClass> *(^)(NSString * pathurl))pathurl;
/// 完整地URL 重新赋值baseurl 清空pathurl
- (YHRequest<ResponseClass> *(^)(NSString * fullurl))fullurl;


@end

NS_ASSUME_NONNULL_END
